const mongoose = require('./index');

const userSchema = new mongoose.Schema({
    background: { type: String },
    avatar: { type: String },
    surname: { type: String, required: true, unique: true },
    name: { type: String, required: true, unique: true }, 
    username: { type: String, required: true, unique: true },
    password: { type: String, required: true },
    gender: { type: Number, },
    email: { type: String, required: true, unique: true },
    phonenumber: { type: String, required: true, unique: true },
    birthday: { type: Date, default: Date.now }
});

const User = mongoose.model('User', userSchema, 'User');

module.exports = {
    User
};
